// default value takes effects only
// when declaring the function 

#include <iostream>
using namespace std;

class base
{
public:
 virtual void  function(int i, int j=105) =0;
};
 

class derived1:public base
{
public:
 void   function(int i, int j = 55)
 {
  cout<<"derived1"<< endl;
  cout<<i<<"   "<<j << endl;
 }

};

class derived2:public base
{
public:
 void  function(int i, int j = 50)
 {
  cout<<"derived2"<< endl;
  cout<<i<<"   "<<j<< endl;
 }

};


 int main()
 {
  

   derived1 d1;
   derived2 d2;
   base *b = &d1;

   b->function(12);

	b = &d2;

   b->function(12);

   d1.function(12);
   d2.function(12);
   	return 0;
 }

 
